package com.smooth.dao.gen;

import com.smooth.dao.gen.bean.BizAddress;
import com.smooth.dao.gen.bean.BizAddressExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface BizAddressMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table biz_address
     */
    @SelectProvider(type=BizAddressSqlProvider.class, method="countByExample")
    long countByExample(BizAddressExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table biz_address
     */
    @DeleteProvider(type=BizAddressSqlProvider.class, method="deleteByExample")
    int deleteByExample(BizAddressExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table biz_address
     */
    @Delete({
        "delete from biz_address",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table biz_address
     */
    @Insert({
        "insert into biz_address (id, user_id, ",
        "user_name, user_telno, ",
        "province_id, province_name, ",
        "city_id, city_name, ",
        "area_id, area_name, ",
        "address_detail, post_code, ",
        "create_date, update_date)",
        "values (#{id,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR}, ",
        "#{userName,jdbcType=VARCHAR}, #{userTelno,jdbcType=VARCHAR}, ",
        "#{provinceId,jdbcType=VARCHAR}, #{provinceName,jdbcType=VARCHAR}, ",
        "#{cityId,jdbcType=VARCHAR}, #{cityName,jdbcType=VARCHAR}, ",
        "#{areaId,jdbcType=VARCHAR}, #{areaName,jdbcType=VARCHAR}, ",
        "#{addressDetail,jdbcType=VARCHAR}, #{postCode,jdbcType=VARCHAR}, ",
        "#{createDate,jdbcType=TIMESTAMP}, #{updateDate,jdbcType=TIMESTAMP})"
    })
    int insert(BizAddress record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table biz_address
     */
    @InsertProvider(type=BizAddressSqlProvider.class, method="insertSelective")
    int insertSelective(BizAddress record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table biz_address
     */
    @SelectProvider(type=BizAddressSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_name", property="userName", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_telno", property="userTelno", jdbcType=JdbcType.VARCHAR),
        @Result(column="province_id", property="provinceId", jdbcType=JdbcType.VARCHAR),
        @Result(column="province_name", property="provinceName", jdbcType=JdbcType.VARCHAR),
        @Result(column="city_id", property="cityId", jdbcType=JdbcType.VARCHAR),
        @Result(column="city_name", property="cityName", jdbcType=JdbcType.VARCHAR),
        @Result(column="area_id", property="areaId", jdbcType=JdbcType.VARCHAR),
        @Result(column="area_name", property="areaName", jdbcType=JdbcType.VARCHAR),
        @Result(column="address_detail", property="addressDetail", jdbcType=JdbcType.VARCHAR),
        @Result(column="post_code", property="postCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_date", property="createDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_date", property="updateDate", jdbcType=JdbcType.TIMESTAMP)
    })
    List<BizAddress> selectByExample(BizAddressExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table biz_address
     */
    @Select({
        "select",
        "id, user_id, user_name, user_telno, province_id, province_name, city_id, city_name, ",
        "area_id, area_name, address_detail, post_code, create_date, update_date",
        "from biz_address",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_name", property="userName", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_telno", property="userTelno", jdbcType=JdbcType.VARCHAR),
        @Result(column="province_id", property="provinceId", jdbcType=JdbcType.VARCHAR),
        @Result(column="province_name", property="provinceName", jdbcType=JdbcType.VARCHAR),
        @Result(column="city_id", property="cityId", jdbcType=JdbcType.VARCHAR),
        @Result(column="city_name", property="cityName", jdbcType=JdbcType.VARCHAR),
        @Result(column="area_id", property="areaId", jdbcType=JdbcType.VARCHAR),
        @Result(column="area_name", property="areaName", jdbcType=JdbcType.VARCHAR),
        @Result(column="address_detail", property="addressDetail", jdbcType=JdbcType.VARCHAR),
        @Result(column="post_code", property="postCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_date", property="createDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_date", property="updateDate", jdbcType=JdbcType.TIMESTAMP)
    })
    BizAddress selectByPrimaryKey(String id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table biz_address
     */
    @UpdateProvider(type=BizAddressSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") BizAddress record, @Param("example") BizAddressExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table biz_address
     */
    @UpdateProvider(type=BizAddressSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") BizAddress record, @Param("example") BizAddressExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table biz_address
     */
    @UpdateProvider(type=BizAddressSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(BizAddress record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table biz_address
     */
    @Update({
        "update biz_address",
        "set user_id = #{userId,jdbcType=VARCHAR},",
          "user_name = #{userName,jdbcType=VARCHAR},",
          "user_telno = #{userTelno,jdbcType=VARCHAR},",
          "province_id = #{provinceId,jdbcType=VARCHAR},",
          "province_name = #{provinceName,jdbcType=VARCHAR},",
          "city_id = #{cityId,jdbcType=VARCHAR},",
          "city_name = #{cityName,jdbcType=VARCHAR},",
          "area_id = #{areaId,jdbcType=VARCHAR},",
          "area_name = #{areaName,jdbcType=VARCHAR},",
          "address_detail = #{addressDetail,jdbcType=VARCHAR},",
          "post_code = #{postCode,jdbcType=VARCHAR},",
          "create_date = #{createDate,jdbcType=TIMESTAMP},",
          "update_date = #{updateDate,jdbcType=TIMESTAMP}",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(BizAddress record);
}